import { createRouter, createWebHashHistory } from 'vue-router'
import Cartlist from '../views/Cartlist.vue'
import Cartdateils from '../views/Cartdateils.vue'

const routes = [
  {
    path:'/',
    redirect: '/cartlist',  // 重定向:重新指向其它path,会改变网址
  },
  {
    path: '/cartlist',
    component: Cartlist
  },
  {
    path: '/cartdateils/:id',
    component: Cartdateils
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
